package com.wanger.common.util;

import lombok.Data;

import java.io.Serializable;

/**
 * @Author: wanger
 * @Date: 2023/8/17 22:19
 * @Description:
 */

@Data
public class ApiResult<T> implements Serializable {

    private static final long serialVersionUID = 6063461542960336006L;

    private T data;

    private Integer code = 200;

    private String message = "message";

    private static final String TIP_MESSAGE = "当前系统错误，请稍后再试";

    public ApiResult<T> setMessage(String message) {
        this.message = message;
        return this;
    }

    public ApiResult() {
    }

    public ApiResult(T data) {
        this.data = data;
    }

    public ApiResult(T data, String message) {
        this.data = data;
        this.message = message;
    }

}
